package test;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class MyFrame extends JFrame{
	private JLabel l = new JLabel("username");
	private JTextField tf = new JTextField(10);
	private JPanel p = new ImgPanel("/home/tarena/Pictures/2.jpg");
	
	public MyFrame() {
		this.init();
		this.addCom();
	}
	private void addCom() {
		this.add(p);
		p.add(tf);
		p.add(l);
	}
	private void init() {
//		Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
//		int height=(int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
//		int width=(int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
//		setBounds((size.width-size.width/2)/2, (size.height-size.height/2)/2, size.width/2, size.height/2);
		this.setSize(400,300);
		this.setLocationRelativeTo(null);
	}
}
